<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="lib/vue.js"></script>
</head>
<body>
<div id="app">
    <p>{{msg | dancun("疯狂")}}</p>
</div>
<script>
    Vue.filter("dancun",function (msg,arg) {
        return msg.replace(/单纯/g,arg)
        //正则匹配
    })
    var vm = new Vue({
        el:"#app",
        data:{
            msg:"曾经单纯，现在单纯，以后单纯"
        }
    })
    // Vue.filter("dancun",function (msg) {
    //     return msg.replace("单纯","邪恶")
    // })
</script>

</body>
</html>